﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Xsl;

namespace DNNEventLogViewer
{
    public class XmlBrowser: WebBrowser
    {
        public XmlDocument DocumentXml
        {
            set
            {
                Stream s =this.GetType().Assembly.GetManifestResourceStream("DNNEventLogViewer.defaultss.xsl");
                XmlReader xr = XmlReader.Create(s);
                XslCompiledTransform xct = new XslCompiledTransform();
                xct.Load(xr);
                StringBuilder sb = new StringBuilder();
                XmlWriter xw = XmlWriter.Create(sb);
                xct.Transform(value, xw);
                this.DocumentText = sb.ToString();
            }
        }
    }
}
